package com.xy.breakfast.service;

import com.xy.breakfast.entity.Foods;
import com.xy.breakfast.mapper.FoodsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

//食品服务类
@Service
public class FoodsService implements FoodsMapper {


    @Autowired
    FoodsMapper foodsMapper;

    @Override
    public Foods getById(int id) {
        return foodsMapper.getById(id);
    }

    @Override
    public void save(Foods t) {
        foodsMapper.save(t);
    }

    @Override
    public void deleteById(int id) {

    }

    @Override
    public void update(Foods t) {
        foodsMapper.update(t);
    }

    @Override
    public List<Foods> getAll() {
        return foodsMapper.getAll();
    }

    @Override
    public List<Map<String, Object>> getFoodsSalePrice() {
        return foodsMapper.getFoodsSalePrice();
    }

    //当天不同类型的销售额
    @Override
    public List<Map<String, String>> getFoodsByTypesIdDay() {
        return foodsMapper.getFoodsByTypesIdDay();
    }

//    不同类型销售比例图
    @Override
    public List<Map<String, Object>> getFoodsByNum() {
        return foodsMapper.getFoodsByNum();
    }

    //按名字查询
    @Override
    public List<Foods> getBooksByName(String name) {
        return foodsMapper.getBooksByName(name);
    }


    //按照类型获取食品
    @Override
    public List<Foods>getByTypesId(int typesId){
        return foodsMapper.getByTypesId(typesId);
    }

    @Override
    public List<Foods> getPage(int start, int end) {
        return null;
    }
}
